package rest_api

import (
	"io"
	"io/ioutil"

	json "github.com/json-iterator/go"
)

func RetrieveHTTPBody(r io.Reader, v interface{}) error {
	bin, err := ioutil.ReadAll(r)
	if nil != err {
		return err
	}

	return json.Unmarshal(bin, v)
}
